cmake_minimum_required(VERSION 3.11)

# 使用C99标准
set(CMAKE_C_STANDARD 99)

# 项目名称
project(SurroundEarth)

# 引擎
file(GLOB ENGINE_SRC_FILES "../engine/src/*.c")

message(STATUS "engine src files-------: ${ENGINE_SRC_FILES}")

# 你的可执行文件
add_executable(SurroundEarth main.c ${ENGINE_SRC_FILES})

# file(COPY res/ DESTINATION ${PROJECT_BINARY_DIR}/res)

# message(STATUS "CMAKE_BINARY_DIR-------: ${CMAKE_BINARY_DIR}")

# 自定义命令的工作目录
add_custom_command(
    TARGET SurroundEarth POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_directory 
        ${CMAKE_SOURCE_DIR}/surround-earth/res 
        ${CMAKE_BINARY_DIR}/surround-earth/res
    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/surround-earth  # 在项目根目录执行
)


# 链接 Raylib
target_link_libraries(SurroundEarth PRIVATE raylib)
